//SamXIAO
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}
#define N_MAX 987654321
#define N_MIN -N_MAX
int f[286];
char s1[1086];
char s2[2020];
void w1()
{
	int cnt = 0, ans = 0, n;
	scanf("%s", s1);
	bool isOk = true;
	for(int i=0; i<strlen(s1); i++) {
		char ch = s1[i], ch2;
		if('A' == ch) ch2 = 'T';
		if('T' == ch) ch2 = 'A';
		if('G' == ch) ch2 = 'C';
		if('C' == ch) ch2 = 'G';
		printf("%c", ch2);
	}
}

int main()
{
	w1();
  return 0;
}
